use serde::Serialize;

#[derive(Debug, Serialize)]
pub struct ApiResponse {
    pub success: bool,
    pub result: String,
    pub error: Option<String>,
}

impl ApiResponse {
    pub fn success(result: String) -> Self {
        Self {
            success: true,
            result,
            error: None,
        }
    }

    pub fn error(error: String) -> Self {
        Self {
            success: false,
            result: String::new(),
            error: Some(error),
        }
    }
} 